package com.meituan.catering.management.shop.dao.mapper;

import com.meituan.catering.management.shop.dao.model.ShopDO;
import com.meituan.catering.management.shop.dao.model.request.SearchShopDataRequest;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;

/**
 * 门店对应的MyBatis Mapper
 */
@Mapper
public interface ShopMapper {

    List<ShopDO> searchForPage(SearchShopDataRequest requestDO);

    int countForPage(SearchShopDataRequest dataRequest);

    ShopDO findByBusinessNo(Long tenantId, String businessNo);

    int countByBusinessNo(@Param("businessNo") String businessNo);

    int insert(ShopDO shopDO);

    int update(ShopDO updatingShopDO);

    /**
     * 改变状态DO接口
     * @param tenantId 租户号
     * @param id 唯一标识
     * @param enabled 状态码
     * @param version 版本号
     * @return 返回受影响条目
     */
    int changeEnabledById(Long tenantId, Long id, Integer enabled, Integer version);
}
